import React, { Component } from 'react';
import { Button } from 'choerodon-ui';
import { connect } from 'dva';
import styles from './style.less';

class Page extends Component {
  componentDidMount() {
    const { dispatch } = this.props as any;
    dispatch({
      type: 'BLOCK_NAME_CAMEL_CASE/fetch',
    });
  }

  render() {
    const { text } = this.props as any;
    return (
      <div className={styles.container}>
        <Button>{text}</Button>
      </div>
    );
  }
}

export default connect(
  ({
    BLOCK_NAME_CAMEL_CASE,
  }: {
    BLOCK_NAME_CAMEL_CASE: any;
  }) =>
    ({
      BLOCK_NAME_CAMEL_CASE,
    } as any)
)(Page);
